mshv: mount nvme resource disk for VM image copies#4434
Merged
Conversation
🤖 AI Test SelectionNo test cases were selected for this PR. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the MSHV host stress test to avoid copying many large guest disk images onto the OS disk on NVMe-based Azure SKUs by detecting whether /mnt/resource or /mnt are actually backed by a mounted disk, and (when neither is mounted) attempting to format+mount an unused nvme*n1 disk at /mnt/resource for disk image copies.
Changes:
- Replace the prior “
/mntdirectory exists” heuristic withlsblk-based mountpoint detection for/mnt/resourceand/mnt. - Add logic to select an unused NVMe namespace disk and mount it as ext4 at
/mnt/resourceto host VM disk image copies, with fallback to the node working path. - Add helper methods for mountpoint detection and NVMe disk selection.
LiliDeng
reviewed
Apr 27, 2026
The previous logic in MshvHostStressTestSuite._get_disk_img_copy_path treated existence of /mnt as proof that a large resource disk was mounted there. On NVMe-based Azure SKUs the temporary disks show up as /dev/nvme*n1 and are not mounted anywhere, so the test ended up copying many large guest images onto the small OS disk and ran out of space. Use lsblk to detect what is actually mounted at /mnt/resource and /mnt and reuse those when present. Otherwise pick an unused nvme*n1 disk (not the OS disk, no partitions, nothing mounted), format it as ext4, and mount it at /mnt/resource. Fall back to the working path if no suitable disk is found or the mount fails. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Anirudh Rayabharam <anrayabh@microsoft.com>
89c06b4 to
a973479
Compare
🤖 AI Test SelectionNo test cases were selected for this PR. |
LiliDeng
approved these changes
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The previous logic in MshvHostStressTestSuite._get_disk_img_copy_path treated existence of /mnt as proof that a large resource disk was mounted there. On NVMe-based Azure SKUs the temporary disks show up as /dev/nvme*n1 and are not mounted anywhere, so the test ended up copying many large guest images onto the small OS disk and ran out of space.
Use lsblk to detect what is actually mounted at /mnt/resource and /mnt and reuse those when present. Otherwise pick an unused nvme*n1 disk (not the OS disk, no partitions, nothing mounted), format it as ext4, and mount it at /mnt/resource. Fall back to the working path if no suitable disk is found or the mount fails.
Description
Related Issue
Type of Change
Checklist
Test Validation
Key Test Cases:
Impacted LISA Features:
Tested Azure Marketplace Images:
Test Results